package com.gxa.medical.config;
import java.io.FileWriter;
import java.io.IOException;
/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016102600763897";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCJsW00CYErxSBn+KWuWr97rl1pb76b2LxYgTDhYN9fJF0vJtNh6UzOk/dMEBzWD7FGu+6dMrkTIeAy6qkXN8lvHmENUSfdPHlLsALjIethHl1ZrUnbk6WR0ReXPGdlqias0x7q4ebXlk2Ssiot77WptGo8rJO3fes3ML7CebF5mRjy3ZEsuDdUMW8ie3VgmSYyDZhIVIoxy3gmb+Of8QC78gO+qMhIRLmrtt7J1i07fbmQ8dHaVON3hjVW6dKeaWztavNRnDXAumfQwobFXnW0kMyC0hJi5LfGTJLEtati+KCD/wmkEe4/w0PMtjn+exbg2au5JGbi8Cvln2ZKEdY1AgMBAAECggEAFlxlAqVkf8o0mA3uQiFkpV5Mtzm5d6+77peUa5WC0P2j0Gt6upTbr1SiPY0EUdMclAMjHg5FthCzSzGGokmiAdSqKDJ8ydXvUNZVsbMpeY0n1c9phio1IjgVn67kj8MRItHqXHSxO2OiV2dtqCYcl2HAOvg/yPW/BCh7YjPHGZr/TrgRxDulAUzhDodUpigO4KToe8SKo5UDa/nce0AOALyFEcHsgAcGhRhehxPUhAydiyzXL0hEfoWOeRwtexT85M7AwT2lju/TCdo4YxMnt8tOw/GnW2gCYREW7AIYCMlbloMoc9jbkC4quGq1TSl94Oqw/yjx3gz2Hy4F7Lc1ZQKBgQDymHuXE3tkYi3i9h+4Vr/2DYThxl/pZ3wJoQfqRyfzJ8G76yahrx/1xp4D2yhnqbXuhcouz9Ao7FDvGmw0ceY/GExghFObD8AcJklgQdaB5H0LQebl3Xxv/GMrE+2c1/WFTCFPEa/gdeNcCRAW5Ntv3H4mFGnLTMyaGIJeBdj5VwKBgQCRTRigZXPsrw1UJKbmo5rEzLhoXbTgewnq2m2RQ+Tml+d/76B/+1EbQPvOzHdfcRa41xgW+bG85/ToXTAIExnNQ11QreiKOYslQq0+iTf63JWU3ntwU3zgEZqCoML0211xF4U8v5604uuxoVCDjqX0Ev4HV8Jy0O3zT2gyUWyZUwKBgQC2WePchapkpF/1kCf7ukmEvFi8FQ8XNNBJtJ9sfJwM7D9176YUNr0BU5CHOX8/nJPCfRKi6VaAzFFxyRy4tzzpBGy0yALINaikACt7jUGeVY+gnKLg+gGFc+NfCBW9pZ9J2RXYh2T6heKm1bEgZFqF1OmF2iZDyLCqy+2Cm0ai9QKBgDL9EQVIVNPb4huC+Sa6htdE1/mX2J9lzeciW4y8fJkG+XAF0RbYRHAB79t0GPffIZAfuw5k9SBLbcAU44QR394OI7LqNE49Pz0GFvF5CbH4sm0ZXcvfIFUpGEV60K9IQ5QqItFclP75Gqis6SohZs8t0wMUouHTu4zEctYliKyNAoGAb3IuPUZMyex1ObPRpf/4BarXfqw1MMRjOtwp1laWeuqJeZsLvoBI4Rx/YZ/xifXfug0udSwhHlsitBpl5oJZi44u/qbbhagqXD2zCCaKvr1BA+JWBnQZF0Tr1ud8gcPU0aT1hO6oGgKhUjrRWRi+new3v94ewvwlNT7ASXCZ0UQ=" ;

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key ="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6cauIdB1q5mzNI/jm9C4QRRMMrgQjzZhO7tb+Jyc9QkMluQ0sVG0w3He3AkpXAHf9N9HbCfX3QMVitgYrBWxGOKonSozc+0wymakCjM5Oy1tMfoQ8loOyJBhszYJ6GhfKgLmrZ3BaGL222QGxMm0j6F4iFSNK3teXTZw3tmflTlF1i8JlrcBQtGM7fZ+4NM06wLAOfclWUTHKNCcZPtxkrow8Obr6L0X8LU74GOv0hw9Wp6e8wJESYmuVrMyw8/talRK2902NRwKhxGMJuxO86ChfQgQz555oTTKkDiH2y/nKmv/jF2Z9TQh0iS4z5tUek/Ed0TKjbAOKvwYqy9WJwIDAQAB";
    //    		"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6cauIdB1q5mzNI/jm9C4QRRMMrgQjzZhO7tb+Jyc9QkMluQ0sVG0w3He3AkpXAHf9N9HbCfX3QMVitgYrBWxGOKonSozc+0wymakCjM5Oy1tMfoQ8loOyJBhszYJ6GhfKgLmrZ3BaGL222QGxMm0j6F4iFSNK3teXTZw3tmflTlF1i8JlrcBQtGM7fZ+4NM06wLAOfclWUTHKNCcZPtxkrow8Obr6L0X8LU74GOv0hw9Wp6e8wJESYmuVrMyw8/talRK2902NRwKhxGMJuxO86ChfQgQz555oTTKkDiH2y/nKmv/jF2Z9TQh0iS4z5tUek/Ed0TKjbAOKvwYqy9WJwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    //public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

